﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserManage.aspx.cs" Inherits="DataAnalyseTool.Web.Pages.UserManage1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>用户管理</title>
    <link href="../../Resources/Styles/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../Resources/Styles/icon.css" rel="stylesheet" type="text/css" />
    <link href="../../Resources/Styles/Reset.css" rel="stylesheet" type="text/css" />
    <link href="../../Resources/Styles/UserManager.css" rel="stylesheet" type="text/css" />
    <script src="../../Resources/Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../../Resources/Scripts/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../Resources/Scripts/UserManager.js" type="text/javascript"></script>
    <script src="../../Resources/Scripts/easyui-lang-zh_CN.js" type="text/javascript"></script>
</head>
<body style="text-align: center; font-size: 35px">
    <div style="margin: 0 auto; width: 800px;">
        <input id="isAdmin" type="hidden" value='<%=IsAdmin%>' name="containsProFields" />
        <input id="userName" type="hidden" value='<%=CurrentUserName%>' name="containsProFields" />
        <table id="dg" title="所有用户" class="easyui-datagrid" style="width: 1030px; font-size: larger;
            height: 800px" url="../../BusinessTier/Handlers/UserHandler.ashx?action=Get" toolbar="#toolbar"
            pagination="true" rownumbers="true" fitcolumns="true" singleselect="true">
            <thead>
                <tr>
                    <th field="UserName" width="50">
                        用户名
                    </th>
                    <th field="Password" width="50">
                        密码
                    </th>
                    <th field="IsAdmin" width="50">
                        是否管理员
                    </th>
                    <th hidden="true" field="ContainsProFileds" width="50">
                        可操作字段
                    </th>
                </tr>
            </thead>
        </table>
        <div id="toolbar">
            <%if (IsAdmin == true)
              { %>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-add" plain="true"
                onclick="newUser()">添加用户</a>
            <%} %>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-edit" plain="true"
                onclick="editUser()">编辑用户</a>
            <%if (IsAdmin == true)
              { %>
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-remove" plain="true"
                onclick="destroyUser()">删除用户</a>
            <%} %>
        </div>
        <div id="dlg" class="easyui-dialog" style="width: 720px; height: 310px;" closed="true"
            buttons="#dlg-buttons">
            <form id="fm" method="post" novalidate>
            <fieldset>
                <legend>安全信息</legend>
                <div class="fitem" style="margin-top: 10px">
                    <table class="BaseInfo" style="width: 100%">
                        <tr>
                            <td>
                                用户名:
                                <input name="UserName" class="easyui-validatebox" required="true" missingmessage="用户名不能为空!">
                            </td>
                            <td>
                                密码:
                                <input name="Password" class="easyui-validatebox" required="true" missingmessage="密码不能为空!"
                                    validtype="length[6,12]" invalidmessage="密码必须在6-12位之间!">
                            </td>
                            <td style="visibility: hidden">
                                是否管理员: 是<input required="true" type="radio" value="true" name="IsAdmin" />&nbsp;&nbsp;&nbsp;
                                否<input type="radio" required="true" value="false" checked="checked" name="IsAdmin" />
                            </td>
                        </tr>
                    </table>
                </div>
            </fieldset>
            <fieldset style="padding: 10px;">
                <legend>可编辑字段权限分配</legend>
                <div class="" style="margin-top: 10px;">
                    <table class="EditableField" style="width: 100%">
                        <tr>
                            <td>
                                QQ账户:
                            </td>
                            <td>
                                <select name="QQ">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                旺旺账户:
                            </td>
                            <td>
                                <select name="Wangwang">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                支付宝账户:
                            </td>
                            <td>
                                <select name="ZhifubaoAccount">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                支付宝姓名:
                            </td>
                            <td>
                                <select name="ZhifubaoName">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                绑定支付宝账户:
                            </td>
                            <td>
                                <select name="RebateZhifubao">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                绑定支付宝姓名:
                            </td>
                            <td>
                                <select name="RebateZhifubaoName">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                财付通账户:
                            </td>
                            <td>
                                <select name="CaifutongAccount">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                财付通姓名:
                            </td>
                            <td>
                                <select name="CaifutongName">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                店铺:
                            </td>
                            <td>
                                <select name="ShopID">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                金额:
                            </td>
                            <td>
                                <select name="Cash">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                手机:
                            </td>
                            <td>
                                <select name="Cellphone">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                固定电话:
                            </td>
                            <td>
                                <select name="Fixphone">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                收件人姓名:
                            </td>
                            <td>
                                <select name="ReceiveName">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                收件人地址:
                            </td>
                            <td>
                                <select name="ReceiveAddress">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                收件人手机:
                            </td>
                            <td>
                                <select name="ReceiveCellphone">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                收件人固定电话:
                            </td>
                            <td>
                                <select name="ReceiveFixphone">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                日期：
                            </td>
                            <td>
                                <select name="Date">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                                地址:
                            </td>
                            <td>
                                <select name="Address">
                                    <option value="1">授权</option>
                                    <option value="0" selected="selected">拒绝</option>
                                </select>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>
                </div>
            </fieldset>
            </form>
        </div>
        <div id="dlg-buttons">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-ok" onclick="saveUser()">
                保存</a> <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel"
                    onclick="javascript:$('#dlg').dialog('close')">取消</a>
        </div>
        <style type="text/css">
            #fm
            {
                margin: 0;
                padding: 10px 30px;
            }
            .ftitle
            {
                font-size: 14px;
                font-weight: bold;
                padding: 5px 0;
                margin-bottom: 10px;
                border-bottom: 1px solid #ccc;
            }
            .fitem
            {
                margin-bottom: 5px;
            }
            .fitem label
            {
                display: inline-block;
                width: 80px;
            }
        </style>
    </div>
</body>
</html>
